import {createRouter, createWebHistory} from "vue-router";
import PurchaserLayoutView from "@/views/PurchaserLayoutView.vue";
import LoginView from "@/views/LoginView.vue";
import ManagerLayoutView from "@/views/ManagerLayoutView";
import ManagerHomeView from "@/views/ManagerHomeView";
import CheckGoodsView from "@/views/Goods/CheckGoodsView";
import SupplierLayoutView from "@/views/SupplierLayoutView.vue";
import FinancialManagement_S from "@/views/FinancialViews/FinancialManagement_S.vue";
import GoodsCategoryView from "@/views/Goods/GoodsCategoryView";
import PurchaserOrder from "@/views/orders/PurchaserOrder.vue";
import GoodsManagementView from "@/views/Goods/GoodsManagementView";
import FinancialManagement_P from "@/views/FinancialViews/FinancialManagement_P.vue";
import DataAnalysisView from "@/views/DataCenter/DataAnalysisView";
import PurchaserBasicInfo from "@/views/PurchaserInfo/PurchaserBasicInfo.vue";
import SupplierBasicInfo from "@/views/SupplierInfo/SupplierBasicInfo.vue";
import ManagerBasicInfo from "@/views/ManagerInfo/managerBasicInfo.vue";
import PurchaserHomeView from "@/views/PurchaserHomeView";
import ManagePurchaser from "@/views/manage/ManagePurchaser.vue";
import ManageSupplier from "@/views/manage/ManageSupplier.vue";
import SupplierOrder4Completed from "@/views/orders/SupplierOrder4Completed.vue";
import SupplierOrder4Deliver from "@/views/orders/SupplierOrder4Deliver.vue";
import ShoppingCartView from "@/views/ShoppingCart/ShoppingCartView";

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes: [
        {
            path: '/', component: PurchaserLayoutView,
            redirect: '/purchaser/purchaserHome',
        },
        {
            path: '/purchaser',
            component: PurchaserLayoutView,
            children: [
                {
                    path: '/purchaser/order',
                    component: PurchaserOrder
                }, {
                    path: '/purchaser/walletManagement',
                    component: FinancialManagement_P
                }, {
                    path: '/purchaser/basicInfo',
                    component: PurchaserBasicInfo
                }, {
                    path: '/purchaser/purchaserHome',
                    component: PurchaserHomeView
                }, {
                    path: '/purchaser/shoppingCart',
                    component: ShoppingCartView
                }
            ]
        },
        {path: '/login', component: LoginView},
        {
            path: '/manager', component: ManagerLayoutView,
            children: [
                {path: '/manager/managerHome', component: ManagerHomeView},
                {path: '/manager/goodsCategory', component: GoodsCategoryView},
                {path: '/manager/checkGoods', component: CheckGoodsView},
                {path: '/manager/basicInfo', component: ManagerBasicInfo},
                {
                    path: 'managePurchaser',
                    component: ManagePurchaser
                },
                {
                    path: 'manageSupplier',
                    component: ManageSupplier
                }
            ]
        },
        {
            path: '/supplier', component: SupplierLayoutView, children: [
                {path: '/supplier/walletManagement', component: FinancialManagement_S},
                {path: '/supplier/goodsManagement', component: GoodsManagementView},
                {path: '/supplier/dataAnalysis', component: DataAnalysisView},
                {path: '/supplier/basicInfo', component: SupplierBasicInfo},
                {
                    path: 'order4Completed',
                    component: SupplierOrder4Completed
                },
                {
                    path: 'order4Deliver',
                    component: SupplierOrder4Deliver
                }
            ]
        }

    ]
})
export default router
